<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=9" />
		<meta http-equiv="pragma" content="no-cache" />
		<title>井冈山智慧社区-网站地图</title>	
		<%@ include file="../common/Website-list.jsp"%>	
		<style>
			.container {
			    float: left;
			    margin-bottom: 8px;
			    margin-left:100px;
			    width: 950px;
			}			
			
			.title {
			    background: rgba(0, 0, 0, 0) url("<%=basePath%>/pages/WebSitePc/images/i3.gif") no-repeat scroll 0 0;
			    float: left;
			    height: 40px;
			    width: 950px;
			}
						
			.title h2 {
			    color: #677e9d;
			    font-family: "微软雅黑","黑体";
			    font-size: 20px;
			    font-weight: normal;
			    padding: 3px 0 0 25px;
			}
			
			.box2 {
			    -moz-border-bottom-colors: none;
			    -moz-border-left-colors: none;
			    -moz-border-right-colors: none;
			    -moz-border-top-colors: none;
			    border-color: -moz-use-text-color #d3e8f7 #d3e8f7;
			    border-image: none;
			    border-style: none solid solid;
			    border-width: 0 1px 1px;
			    float: left;			   
			    line-height: 38px;
			    padding: 0 20px;
			    width: 908px;
			}
						
			.box2 a:link, .box2 a:visited, .box2 a:hover, .box2 a:active {
			    display: inline;
			    margin-right: 22px;
			}
			.box2 a {
			    color: #64b842;
			}
		</style>
		<script type="text/javascript">
		jQuery(document).ready(function(){				
			//获取菜单
			$.ajax({  
				type: "POST",  
		        url: $ctx+'SiteIndex/querySiteNav.json', 
		        async: false,
			    data:{  
			    	  issue:'1',
			    	  parentID:0,
			    	  typeID:0 //顶部导航
			    },  		    	     
			    cache:false,  
			    dataType:'json',  
			    success:function(data) { 
			    	if(data!=null && data.length>0){		    	    		
			    		$.each(data,function(idx,obj){
			    			var addhtml='';
			    			var url=$ctx+obj.url;
			                if(obj.isParent=="true"){
			                	addhtml = '<div class="container">'+
								  			'<div class="title"><h2 align="left">'+obj.menuName+'</h2></div>';			    	                	
		    	                var senhtml=findSubNavSiteMap(obj.id);	 //查找二级菜单		    	               
		    	                addhtml=addhtml+senhtml;
			                }else{
			                	addhtml = '<div class="container">'+
					  							'<div class="title"><h2 align="left">'+obj.menuName+'</h2></div>'+
				  			  			  '</div>';
			                }
			                $(".main").append(addhtml);	
			    		});
			    	}	
			    	
			    	 $(".main").append('<div class="clear"></div>');	
			    },  
			     error : function() {  
			            
			     }  
			});
		});
		
		
		function findSubNavSiteMap(parentId){//二级菜单
			var returnHtml='';
			
			$.ajax({  
				type: "POST",  
		        url: $ctx+'SiteIndex/querySiteNav.json', 
		        async: false,
			    data:{  
			    	  issue:'1',
			    	  parentID:parentId,
			    	  typeID:0 //顶部导航
			    },  		    	     
			    cache:false,  
			    dataType:'json',  
			    success:function(data) { 
			    	if(data!=null && data.length>0){		    	    		
			    		var html='<div class="box2">';
			    		var addhtml='';		    	    		
			    		$.each(data,function(idx,obj){	
			    			var urlNew='';
			    			if(obj.categoryID!=null && obj.categoryID=='1'){ //内容导航
			    				urlNew=$ctx+'SiteIndex/content.htm?fk_menuId='+encode64(String(obj.id))+'&parNav='+parentId;
			    			}else{
			    				if(obj.url!='' && (obj.url).indexOf('http')==-1){
				    				urlNew=$ctx+obj.url;
				    				if(urlNew.indexOf('?')==-1){
				    					urlNew=urlNew+'?parNav='+parentId
				    				}else{
				    					urlNew=urlNew+'&parNav='+parentId
				    				}
				    			}else{
				    				urlNew=obj.url;
				    			}	    				
			    			}
			    			
			    			addhtml += '<a target="_blank" href="'+urlNew+'">'+obj.menuName+'</a>';
			    		});					    		
			    		
			    		returnHtml=html+addhtml+'</div></div>' ;			    			    			    	    		
			    	}	
			    },  
			     error : function() {  
			            
			     }  
			});
			
			return returnHtml;
		}
    	</script>
	</head>
	<body>
		<jsp:include page="../WebSitePc/heads.jsp" />
		<!--main start-->	
		<div class="main">
			<div class="cate01">
				<div class="crumbs">
					您现在位置：<a href="<%=basePath%>" target="_self">首页</a> &gt;					
					<a href = "#" target = "_self">
     					<font color="#2c95b7">网站地图</font>
     				</a >
				</div>
			</div>
			<!-- 导航菜单 -->	
			
		</div>	
		<!--foot start-->
		<jsp:include page="../WebSitePc/footer.jsp" />
	
	</body>
</html>